﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebClient
{
    public partial class ProductDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           if(!this.IsPostBack){
               long id = -1;
               String strId = Request.Params["id"];
               try{
                   id = long.Parse(strId);
               }
               catch{}
               WebData db = new WebData();
               DTO.Products item = db.GetItemByIdProducts(id);
               //lay thong tin chi tiet cua 1 san pham
               if(item!=null){
                   lblImage.Text ="<img src=\""+item.pathImage + "\" border=\"0\"  align=\"middle\" />";
                   lblDes.Text = item.description;
                   lblContent.Text = item.content;
                   lblPrice.Text = item.price.ToString();
               }
           }
        }
    }
}